<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"  isELIgnored="false"%>
    
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<base href="<%=basePath%>">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> -->
  <title>Amaze UI Admin form Examples</title>
  <meta name="description" content="这是一个form页面">
  <meta name="keywords" content="form">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="assets/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="assets/css/admin.css">
  <script type="text/javascript">
  	function deleteUser(){
		var form = document.showUser;
		var idlist = "";
		var count = 0;
		var b = false;
		for(var i=0;i<form.elements.length;i++){
			var target = form.elements[i];
			if(target.name=="ids"&&target.checked==true){
				if(b == false){
					idlist=target.value;
					count++;
				}else{
					idlist += "," + target.value;
					count++;
				}
									
			}
		}
		if(count>0){ 
			document.showUser.action="delUser.action?idlist="+idlist;
			document.showUser.submit();
			
	 	} 
	}	
	function addPage() {
		 window.location.href="test/add.jsp";
	}
  </script>
</head>
<body>

<!-- content start -->
<div class="admin-content">

  <div class="am-cf am-padding">
    <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">表单</strong> / <small>form</small></div>
  </div>

  <hr/>
  
  
   <form class="am-form am-form-horizontal" name="queryAction" method="post" action="<%=path %>/queryTest.action">
     <div class="am-form-group">
       <label for="user-name" class="col-sm-2 am-form-label">ID </label>
       <div class="col-sm-3">
         <input type="password" id="id" name="id" placeholder="ID / ID">
       </div>
       
       <label for="user-email" class="col-sm-2 am-form-label">姓名 </label>
       <div class="col-sm-3">
         <input type="email" id="name" name="name" placeholder="输入你的姓名 / Name">
       </div>
       <button type="submit"  class="am-btn am-btn-primary">查询</button>
    </div>
   </form>
   
	<hr>
	
	<div class="am-g">
      <div class="col-md-6 am-cf">
        <div class="am-fl am-cf">
          <div class="am-btn-toolbar am-fl">
            <div class="am-btn-group am-btn-group-xs">
              <button type="button" class="am-btn am-btn-default" onclick="addPage()"><span class="am-icon-plus"></span> 新增</button> 
              <!-- <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 保存</button>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-archive"></span> 审核</button> -->
              <button type="button" class="am-btn am-btn-default" onclick="deleteUser()"><span class="am-icon-trash-o"></span> 删除</button>
            </div>

            <div class="am-form-group am-margin-left am-fl">
              <select>
                <option value="option1">所有类别</option>
                <option value="option2">IT业界</option>
                <option value="option3">数码产品</option>
                <option value="option3">笔记本电脑</option>
                <option value="option3">只能手机</option>
                <option value="option3">超极本</option>
              </select>
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <div class="am-g">
      <div class="col-sm-12">
      
        <form class="am-form" name="showUser" method="post">
          <table class="am-table am-table-striped am-table-hover table-main">
            <thead>
              <tr>
                <th class="table-check"><input type="checkbox" /></th><th class="table-id">ID</th><th class="table-title">标题</th><th class="table-author">作者</th><th class="table-date">修改日期</th><th class="table-set">操作</th>
              </tr>
          </thead>
          <tbody>
          <c:if test="${not empty user}">
          	<c:forEach items="${user}" var="work">
          		<tr>
	              <td><input type="checkbox" value="${work.id }" name="ids" id="ids"/></td>
	              <td>${work.id }</td>
	              <td>${work.name }</td>
	              <td>${work.password }</td>
	              <td>2014年9月4日 7:28:47</td>
	              <td>
	              	${work.password }
	                <!-- <div class="am-btn-toolbar">
	                  <div class="am-btn-group am-btn-group-xs">
	                    <button class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span> 编辑</button>
	                    <button class="am-btn am-btn-default am-btn-xs"><span class="am-icon-copy"></span> 复制</button>
	                    <button class="am-btn am-btn-default am-btn-xs am-text-danger"><span class="am-icon-trash-o"></span> 删除</button>
	                  </div>
	                </div> -->
	              </td>
	            </tr>
          	
          	</c:forEach>
         </c:if> 	
          	
           
            
          </tbody>
        </table>
		  <div class="am-fr">
		    <ul class="am-pagination">
		      <li>共 15 条记录</li>
		      <li class="am-disabled"><a href="#">«</a></li>
		      <li class="am-active"><a href="#">1</a></li>
		      <li><a href="#">2</a></li>
		      <li><a href="#">3</a></li>
		      <li><a href="#">4</a></li>
		      <li><a href="#">5</a></li>
		      <li><a href="#">»</a></li>
		    </ul>
		  </div>
          
        </form>
      </div>

    </div>

     
  
</div>


<input type="hidden" id="idList" name="idList"/>
</body>
</html>